package com.caishi.lkx.order.pay;

import cn.hutool.core.map.MapUtil;
import com.caishi.lkx.order.config.ApplyPayConfig;
import com.caishi.lkx.order.model.PaymentModel;
import com.caishi.lkx.order.model.PaymentRefundLogModel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;
import java.util.Map;


@Configuration
@Slf4j
public class ApplyPay implements PayPlugins {

    @Resource
    private ApplyPayConfig applyPayConfig;

    @Override
    public Map<String, Object> sign(PaymentModel paymentModel, Object val, Map<String, Object> otherParam) {
        return  MapUtil.<String, Object>builder()
                .put("notifyUrl", applyPayConfig.getNotifyUrl()).build();
    }


    @Override
    public boolean refund(PaymentModel paymentModel, PaymentRefundLogModel paymentRefundLogModel)   {

        return true;
    }

    @Override
    public void postPayCallBack(PaymentModel paymentModel) {

    }
}
